<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png" />
    <button @click="login()">登录</button>
    <button @click="find()">查询</button>
  </div>
</template>

<script>
export default {
  name: "Home",
  methods: {
    login() {
      this.$axios({
        method: "post",
        url: "/api/login",
        data: {
          username: "admin",
          password: "123456",
        },
      }).then((res) => {
        console.log(res);
      });
    },
    find() {
      this.$axios
        .get("/api/find")
        .then(function (response) {
          console.log(response);
        })
        .catch(function (error) {
          console.log(error);
        });
    },
  },
};
</script>
